Imports OMANE.Common.UI
Imports System.Collections.ObjectModel
Imports System.Windows
Imports Infragistics.Windows.Chart
Imports System.Windows.Controls
Imports System.ComponentModel
Imports PTIC_GestionBDD
Imports System.Linq
Imports System.Linq.Expressions



<Serializable()> _
Public Class Police
    Inherits ViewModelBase

    Private _IsBold As Boolean = False
    Public Property IsBold As Boolean
        Get
            Return _IsBold
        End Get
        Set(ByVal value As Boolean)
            OnPropertyChanging("IsBold")
            _IsBold = value
            OnPropertyChanged("IsBold")
            OnPropertyChanged("FontWeight")
        End Set
    End Property

    Private _IsItalic As Boolean = False
    Public Property IsItalic As Boolean
        Get
            Return _IsItalic
        End Get
        Set(ByVal value As Boolean)
            OnPropertyChanging("IsItalic")
            _IsItalic = value
            OnPropertyChanged("IsItalic")
            OnPropertyChanged("FontStyle")
        End Set
    End Property

    Private _Size As Double = 14.0
    Public Property Size As Double
        Get
            Return _Size
        End Get
        Set(ByVal value As Double)
            OnPropertyChanging("Size")
            _Size = value
            OnPropertyChanged("Size")
        End Set
    End Property

    Private _Font As Media.FontFamily = New Media.FontFamily("Calibri")
    <Xml.Serialization.XmlIgnore()> _
    Public Property Font As Media.FontFamily
        Get
            Return _Font
        End Get
        Set(ByVal value As Media.FontFamily)
            OnPropertyChanging("Font")
            _Font = value
            OnPropertyChanged("Font")
        End Set
    End Property

    Public Property FontString As String
        Get
            Return _Font.Source
        End Get
        Set(ByVal value As String)
            _Font = New Media.FontFamily(value)
        End Set
    End Property

    Private _Angle As Double = 0.0
    Public Property Angle As Double
        Get
            Return _Angle
        End Get
        Set(ByVal value As Double)
            OnPropertyChanging("Angle")
            _Angle = value
            OnPropertyChanged("Angle")
        End Set
    End Property

    Private _Distance As Double = 1.0
    Public Property Distance As Double
        Get
            Return _Distance
        End Get
        Set(ByVal value As Double)
            OnPropertyChanging("Distance")
            _Distance = value
            OnPropertyChanged("Distance")
        End Set
    End Property

    Private _Format As String
    Public Property Format As String
        Get
            Return _Format
        End Get
        Set(ByVal value As String)
            OnPropertyChanging("Format")
            _Format = value
            OnPropertyChanged("Format")
        End Set
    End Property

    Private _Visible As Boolean
    Public Property Visible As Boolean
        Get
            Return _Visible
        End Get
        Set(ByVal value As Boolean)
            OnPropertyChanging("Visible")
            _Visible = value
            OnPropertyChanged("Visible")
        End Set
    End Property

    Public Shared ReadOnly Property [Default] As Police
        Get
            Return New Police()
        End Get
    End Property

    Public ReadOnly Property FontWeight As FontWeight
        Get
            Return If(IsBold, FontWeights.Bold, FontWeights.Normal)
        End Get
    End Property

    Public ReadOnly Property FontStyle As FontStyle
        Get
            Return If(IsItalic, FontStyles.Italic, FontStyles.Normal)
        End Get
    End Property

End Class

Public Structure Font
    Private Bold As Boolean
    Private Italic As Boolean
    Private Size As Double
    Private Family As String

End Structure

